package com.jiyun.vo;

import lombok.Data;
import lombok.ToString;

/**
 * @Author yangYingJie
 * @Date 2023/7/31 15：46
 **/
@Data
@ToString
public class Result<T> {
    private String code;
    private String message;
    private T data;

    public static Result<Object> success(Object data){
        Result<Object> o = new Result<>();
        o.setCode("1");
        o.setData(data);
        o.setMessage("操作成功！！");
        return o;
    }

    public static Result error(){
        Result<Object> o = new Result<>();
        o.setCode("2");
        o.setData(null);
        o.setMessage("操作失败！！");
        return o;
    }
}
